package com.juyu.miliao.api.dao.mysql;

import com.juyu.miliao.api.domain.CoolSummerRankingList;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author xuanqicheng
 */
@Repository
public class CoolSummerRankingListDao {

    @Autowired
    private SqlSession sqlSession;

    public CoolSummerRankingList getCoolSummerRankingListByUserId(long userId) {
        return sqlSession.selectOne("getCoolSummerRankingListByUserId",userId);
    }

    public void insertCoolSummerRankingList(CoolSummerRankingList obj) {
        sqlSession.insert("insertCoolSummerRankingList",obj);
    }

    public void updateCoolSummerRankingList(CoolSummerRankingList entity) {
        sqlSession.update("updateCoolSummerRankingList",entity);
    }

    public List<CoolSummerRankingList> getCoolSummerRankingList(){
        return sqlSession.selectList("getCoolSummerRankingList");
    }

    public int updateCoolSummerRankingIsReceive(long userId) {
        return sqlSession.update("updateCoolSummerRankingIsReceive",userId);
    }
}
